<?php
if(isset($_REQUEST['hdn_page'])){
	$v_page=$_REQUEST['hdn_page'];
}else{
	$v_page=1;
}

//Begin//Xay dung chuoi XML chua gia tri
$v_list_xml_tag = "";
if(isset($_REQUEST['hdn_list_xml_tag'])){
	$v_list_xml_tag = $_REQUEST['hdn_list_xml_tag'];
}
$v_list_xml_value = "";
if(isset($_REQUEST['hdn_list_xml_value'])){
	$v_list_xml_value = $_REQUEST['hdn_list_xml_value'];
}

$v_citizen_id_list = "";
if(isset($_REQUEST['hdn_citizen_id_list'])){
	$v_citizen_id_list = $_REQUEST['hdn_citizen_id_list'];
}

$function_code = _CONST_ONEGATE_CITIZEN_DELETE;
if((!_check_permission_on_function($_SESSION['staff_id'], $_ISA_APP_CODE, $function_code))){?>
	<script>
		alert("<? echo _CONST_FUNCTION_PERMISSION_ERROR; ?>");
		if (_MODAL_DIALOG_MODE==1){
			window.location = "<? echo $v_url; ?>";
		}else{
			window.history.back();
		}	
	</script><?
	exit;
}
if(_is_sqlserver()){
	//Cap nhat noi dung cau hoi
	$sql = "Exec Onegate_CitizenDelete " ;
	$sql = $sql . "'" .  $v_citizen_id_list ."'" ;
	//echo $sql; exit;
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$rs = $ado_conn->GetRow($sql); 
	$v_error = _replace_bad_char(trim($rs['RET_ERROR']));
}
sleep(0);
if (!is_null($v_error) && $v_error<>""){?>
	<script>
		alert("<?php echo $v_error; ?>");
		if (_MODAL_DIALOG_MODE==1){
			window.location = "<?php echo $v_goto_url; ?>";
		}else{
			window.history.back();
		}	
	</script><?php
	exit;
}
?>
<form action="index.php" method="post" name="f_back">
	<input type="hidden" name="fuseaction" value="DISPLAY_ALL_CITIZEN">
	<input type="hidden" name="hdn_list_xml_tag" value="<?php echo $v_list_xml_tag ?>">
	<input type="hidden" name="hdn_list_xml_value" value="<?php echo $v_list_xml_value ?>">
	<input type="hidden" name="hdn_page" value="<?php echo $v_page ?>">
</form>
<Script language="javascript">
	document.forms(0).submit();
</Script>